Summary of Advanced Printing Features
Constants and Data Types for Advanced Printing Features
Job Format Modes
typedef OSType gxJobFormatMode; enum { /* job format modes */ gxGraphicsJobFormatMode = (gxJobFormatMode) 'grph', /* graphics mode */ gxTextJobFormatMode = (gxJobFormatMode) 'text', /* text mode */ gxPostscriptJobFormatMode = (gxJobFormatMode) 'post' /* format mode */ }; struct gxJobFormatModeTable { long numModes; /* number of modes */ gxJobFormatMode modes[1]; /* any number of modes */ };Text Job Format (Direct) Mode
typedef long gxQueryType; /* a query type */ enum { /* query types */ gxGetJobFormatLineConstraintQuery = (gxQueryType) 0, /* line */ /* constraint */ gxGetJobFormatFontsQuery = (gxQueryType) 1, /* fonts */ gxGetJobFormatFontCommonStylesQuery = (gxQueryType) 2, /* font common */ /* style */ gxGetJobFormatFontConstraintQuery = (gxQueryType) 3, /* font */ /* constraint */ gxSetStyleJobFormatCommonStyleQuery = (gxQueryType) 4 /* common */ /* style */ }; enum { gxConstraintRange = -1 }; struct gxPositionConstraintTable { gxPoint phase; /* the phase */ gxPoint offset; /* the offset */ long numSizes; /* the number of constraint sizes */ Fixed sizes[1]; /* any number of constraint sizes */ }; struct gxStyleNameTable { long numStyleNames; /* number of style names */ Str255 styleNames[1]; /* any number of style names */ }; struct gxFontTable { long numFonts; /* number of font references */ gxFont fonts[1]; /* any number of font references */ };The Status Structure
enum { /*status type IDs*/ gxNonFatalError = 1, /* affects icon on spooling dialog box */ gxFatalError = 2, /* sends up user alert on spooling */ /* dialog box */ gxPrinterReady = 3, /* signals QuickDraw GX to leave alert */ /* mode */ gxUserAttention = 4, /* signals initiation of a modal alert */ gxUserAlert = 5, /* signals initiation of a movable */ /* modal alert */ gxPageTransmission = 6, /* signals page sent to printer, */ /* increments page count in strings to */ /* user */ gxOpenConnectionStatus = 7, /* signals QuickDraw GX to begin */ /* animation of printer icon */ gxInformationalStatus = 8, /* default status type, no effects */ gxSpoolingPageStatus = 9, /* signals page spooled, increments */ /* page count in spooling dialog box */ gxEndStatus = 10, /* signals end of spooling */ gxPercentageStatus = 11 /* signals to QuickDraw GX the amount */ /* of the print job which is currently */ /* complete */ }; /* status structure */ struct gxStatusRecord { unsigned short statusType; /* the type of status */ unsigned short statusId; /* specific status ID */ unsigned short statusAlertId; /* printing alert ID for status */ Signature statusOwner; /* status owner signature */ short statResId; /* resource ID for 'stat' resource */ short statResIndex; /* index into 'stat' resource */ short dialogResult; /* ID of button selected to dismiss the printing alert box */ unsigned short bufferLen; /* # of bytes in status buffer */ char statusBuffer[1]; /* user response from alert */ };Pen Tables for Vector Devices
enum { gxPenTableTag = 'pent' }; enum { /* pen widths */ gxDeviceUnits = 0, /* device-specific units */ gxMmUnits = 1, /* millimeters */ gxInchesUnits = 2 /* inches */ }; /* pen constants */ enum { gxPenNotLoaded = -1}; /* pen table entry structure */ struct gxPenTableEntry { Str31 penName; /* name of the pen */ gxColor penColor; /* color that is part of the */ /* color set */ fixed penThickness; /* size of the pen */ short penUnits; /* specifies units in which pen */ /* thickness is defined */ short penPosition; /* pen position in the carousel */ }; struct gxPenTable { short numPens; /* number of pen entries in */ /* the following array */ gxPenTableEntry pens[1]; /* array of pen entries */ };Constants and Data Types for Synonyms
General-Purpose PostScript Operator Synonym
#define gxPostScriptTag 0x706f7374 /* 'post' synonym */PostScript Control Information Synonym
#define gxPostControlTag 0x70736374 /* 'psct' synonym */ enum gxPsStateFlags { gxNoSave = 1 /* don't do save-restore around PostScript data */ }; struct gxPostControl { long flags; /* PostScript state flags */ };Dash Synonym
#define gxDashSynonymTag 0x73647368 /* 'sdsh' synonym */ struct gxDashSynonym { long size; /* number of elements in array */ fixed dashLength[gxAnyNumber]; /* array of dash lengths */ };Halftone Synonym
enum { gxFormatHalftoneTag = 'half' }; struct gxFormatHalftoneInfo{ long numHalftones; /* how many halftones */ gxHalftone halftones[1]; /* any number of halftones */ }; struct gxHalftone{ fixed angle; /* direction of halftone */ fixed frequency; /* cells per inch */ gxDotType method; /* kind of pattern */ gxTintType tinting; /* tint calculation method */ gxColor dotColor; /* color of foreground */ gxColor backgroundColor; /* color of background */ gxColorSpace tintSpace; /* color space for tint */ };Line Cap Synonym
#define gxLineCapSynonymTag 0x6c636170 /* 'lcap' synonym */ enum gxLineCaps { /* possible line caps */ gxButtCap = 0, /* square butt cap */ gxRoundCap = 1, /* round cap */ gxSquareCap = 2, /* square cap */ gxTriangleCap = 3 /* triangle cap */ }; typedef long gxLineCapSynonym; /* line cap type */Pattern Synonym
#define gxPatternSynonymTag 0x7074726E /* 'ptrn' synonym */ enum gxPatterns { gxHatch = 0, /* hatch pattern */ gxCrossHatch = 1 /* crosshatch pattern */ ; struct gxPatternSynonym { long patternType; /* one of the patterns: hatch or crosshatch */ fixed angle; /* angle at which pattern is drawn */ fixed spacing; /* distance between two parallel pattern lines */ fixed thickness; /* thickness of the pattern */ gxPoint anchorPoint; /* point with respect to the pattern position */ /* calculated */ };Cubic Synonym
#define gxCubicSynonymTag 0x63756278 /* 'cubx' synonym */ enum gxCubicSynonym { gxIgnoreFlag = 0x0000, /* ignore this word, get next one */ gxLineToFlag = 0x0001, /* draw a line to point following this */ /* flag */ gxCurveToFlag = 0x0002, /* draw a curve through the 3 points */ /* following this flag */ gxMoveToFlag = 0x0003, /* start a new contour at the point */ /* following this flag */ gxClosePathFlag = 0x0004 /* close the contour */ }; #define gxCubicInstructionMask 0x000F /* low 4 bits are point */ /* instructions */ typedef short gxCubicSynonymFlags; /* low 8 bits are instruction (moveto, lineto, curveto, closepath) */QuickDraw Picture Synonym
struct gxQuickDrawPict { gxTranslationOptions options; /* translator options */ Rect srcRect; /* QuickDraw source Rect */ Point styleStretch;/* the scale factor */ unsigned long dataLength; /* length of picture data */ struct gxBitmapDataSourceAlias alias; /* alias to QuickDraw data */ };Functions
Working With Advanced Job Object Functions
void GXSelectJobFormattingPrinter (gxJob aJob, Str31 printerName); gxPrinter GXGetJobFormattingPrinter (gxJob aJob); gxPrinter GXGetJobOutputPrinter (gxJob aJob); void* GXGetJobRefcon (gxJob aJob); void GXSetJobRefcon (gxJob aJob, void *refCon); gxJob GXCopyJob (gxJob srcJob, gxJob dstJob);Manipulating Printer Objects
gxPrinter GXGetJobPrinter (gxJob aJob); gxJob GXGetPrinterJob (gxPrinter aPrinter); void GXForEachPrinterViewDeviceDo (gxPrinter aPrinter, gxViewDeviceProc aViewDeviceProc, void *refCon); long GXCountPrinterViewDevices (gxPrinter aPrinter); gxViewDevice GXGetPrinterViewDevice (gxPrinter aPrinter,long whichViewDevice); void GXSelectPrinterViewDevice (gxPrinter aPrinter, long whichViewDevice); void GXGetPrinterDriverName (gxPrinter aPrinter, Str31 name); void GXGetPrinterName (gxPrinter aPrinter, Str31 name); OSType GXGetPrinterDriverType (gxPrinter aPrinter); OSType GXGetPrinterType (gxPrinter aPrinter);Working With QuickDraw GX Print Files
gxPrintFile GXOpenPrintFile (gxJob aPrintFileJob, FSSpecPtr pFileSpec, char permission); void GXClosePrintFile (gxPrintFile aPrintFile); gxJob GXGetPrintFileJob (gxPrintFile aPrintFile); long GXCountPrintFilePages (gxPrintFile aPrintFile); void GXReadPrintFilePage (gxPrintFile aPrintFile, long pageNumber, long numViewPorts, gxViewPort *viewPortList, gxFormat *pageFormat, gxShape *pageShape); void GXReplacePrintFilePage (gxPrintFile aPrintFile, long pageNumber, gxFormat pageFormat, gxShape pageShape); void GXInsertPrintFilePage (gxPrintFile aPrintFile, long atPageNumber, gxFormat pageFormat, gxShape pageShape); void GXDeletePrintFilePageRange (gxPrintFile aPrintFile, long fromPageNumber, long toPageNumber); void GXSavePrintFile (gxPrintFile aPrintFile, FSSpec *pFileSpec);Working With Paper Types
gxPaperType GXNewPaperType (gxJob aJob, Str31 name, gxRectangle *pageSize, gxRectangle *paperSize); void GXDisposePaperType (gxPaperType aPaperType); gxPaperType GXGetNewPaperType (gxJob aJob,short resID); gxPaperType GXGetJobPaperType (gxJob aJob, long whichPaperType, Boolean forFormatDevice, gxPaperType aPaperType); long GXCountJobPaperTypes (gxJob aJob, Boolean forFormatDevice); gxPaperType GXCopyPaperType(gxPaperType srcPaperType, gxPaperType dstPaperType); void GXGetPaperTypeName (gxPaperType aPaperType, Str31 name); void GXGetPaperTypeDimensions (gxPaperType aPaperType, gxRectangle *aPageSize, gxRectangle *aPaperSize); gxJob GXGetPaperTypeJob (gxPaperType aPaperType); void GXForEachJobPaperTypeDo (gxJob aJob, gxPaperTypeProc aPaperTypeProc, void *refCon, Boolean forFormattingPrinter);Formatting for Specific Devices
void GXSetAvailableJobFormatModes (gxJob aJob, JobFormatModeTableHdl aJobFormatModeTableHdl); gxJobFormatMode GXGetPreferredJobFormatMode (gxJob aJob, Boolean *directOnly); gxJobFormatMode GXGetJobFormatMode (gxJob aJob); void GXSetJobFormatMode (gxJob aJob, gxJobFormatMode aMode); void GXJobFormatModeQuery (gxJob aJob, gxQueryType aQueryType, void *srcData, void *dstData);Color Profile Functions
OSErr GXFindPrinterProfile(gxPrinter thePrinter, void *searchData, long index, gxColorProfile *returnedProfile, long *numProfiles); OSErr GXFindFormatProfile(gxFormat theFormat, void *searchData, long index, gxColorProfile *returnedProfile, long *numProfiles); OSErr GXSetPrinterProfile(gxPrinter thePrinter, gxColorProfile oldProfile, gxColorProfile newProfile); OSErr GXSetFormatProfile(gxFormat theFormat, gxColorProfile oldProfile, gxColorProfile newProfile);Idle Job Function
void GXIdleJob (gxJob aJob);Application-Defined Functions
OSErr GXJobStatus (gxStatusRecord *aStatusRecord); gxLoopStatus MyViewDeviceFunction (gxViewDevice aViewDevice, void *refCon); gxLoopStatus MyPaperTypeFunction (gxPaperType aPaperType, void *refCon);
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help